using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OleDb;
using System.Data;
using DTO;

namespace DAO
{
    public class ChiTietMuonSachDAO
    {
        public List<ChiTietMuonSachDTO> _laydanhsachchitietphieumuon()
        {
            List<ChiTietMuonSachDTO> list = new List<ChiTietMuonSachDTO>();
            string sql = "select * from ChiTietMuonSach";
            DataTable dt = DataProvider.ExcuteQuery(sql);
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataRow dr =  dt.Rows[i];

                    int maphieumuon = int.Parse(dr["MaPhieuMuon"].ToString ());
                    int masach = int.Parse(dr["MaSach"].ToString ());
                    
                    ChiTietMuonSachDTO ctpm = new ChiTietMuonSachDTO();
                    ctpm.Maphieumuon = maphieumuon;
                    ctpm.Masach = masach;
     
                    list.Add(ctpm );
                }
            }
            return list;
        }
        
            
    }
}
